<%--
  Created by IntelliJ IDEA.
  User: 19877
  Date: 2020/6/7
  Time: 23:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>

<head>
    <title>Title</title>
    <script src="js/jquery-3.5.1.min.js"></script>
</head>
<body>

<button id="btn">异步请求</button>



</body>
<script>
    $(function () {
        $("#btn").click(function () {
            $.ajax({
                url:"user/testAjax",
                contentType:"application/json;charset=UTF-8",
                data:'{"uname":"jerry","password":"123456","uid":"1001"}',
                dataType:"json",//预期服务器返回的数据类型
                type:"post",

                success:function (data) {
                    alert(data);
                }
            })
        });
    })
</script>
</html>
